﻿@using ECG.Utility
@model List<ECG.Common.NewsCategoryListMenuDto>

@if (Model.Any())
{
    var MenuParent = Model.Where(m => m.ParentId == 0);
    <div class="box-news-cate box-cate2">
        @foreach (var item in MenuParent)
        {
            var nCateLink = Url.Action("ListNewsCateHome", "News", new { id = item.Id, catename = StringUtil.RemoveSpecialCharactersVn(item.CateName) });
            var childItem = Model.Where(m => m.ParentId == item.Id);
            <div class="cate-title"><a href="@nCateLink" class="news-l2">@item.CateName</a></div>
            if (childItem.Any())
            {
                foreach (var itemChild in childItem)
                {
                    var nCateLinkChild = Url.Action("ListNewsCateHome", "News", new { id = itemChild.Id, catename = StringUtil.RemoveSpecialCharactersVn(itemChild.CateName) });
            <div class="cate-title"><a href="@nCateLinkChild">@itemChild.CateName</a></div>
                }
            }
        }
    </div>
}

@*<div class="box-news-cate box-cate2">
    <div class="cate-title"><a href="#" class="news-l2">Chính sách đổi trả hàng</a></div>
    <div class="cate-title"><a href="#" class="news-l2">Chính sách bảo mật</a></div>
    <div class="cate-title"><a href="#" class="news-l2">Gia đình</a></div>
    <div class="cate-title"><a href="#" class="news-l2">Mua sắm</a></div>
</div>*@